Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fallback to lstat when stat fails on Windows #109235

Merged
merged 3 commits into from
Mar 18, 2023
Merged

Conversation

chaitanyav
Copy link
Contributor

Fixes #109106
@ChrisDenton please let me know if this is the expected behavior for stat on windows

@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ChrisDenton (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 16, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@chaitanyav chaitanyav marked this pull request as draft March 16, 2023 22:31
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost! But if the metadata call returns Ok then we always want to return that. We only want to test if lstat returned a symlink or not.

library/std/src/sys/windows/fs.rs Outdated Show resolved Hide resolved
library/std/src/sys/windows/fs.rs Outdated Show resolved Hide resolved
@chaitanyav chaitanyav marked this pull request as ready for review March 17, 2023 00:56
Copy link
Member

@ChrisDenton ChrisDenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I just have one small style suggestion but otherwise this looks ready to be merged.

library/std/src/sys/windows/fs.rs Outdated Show resolved Hide resolved
library/std/src/sys/windows/fs.rs Outdated Show resolved Hide resolved
@ChrisDenton
Copy link
Member

ChrisDenton commented Mar 17, 2023

Thanks for fixing this! If all goes well with the full suite of CI tests, this should be in nightly soon and released in Rust 1.70.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 17, 2023

📌 Commit 32c589b has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
fallback to lstat when stat fails on Windows

Fixes rust-lang#109106
`@ChrisDenton` please let me know if this is the expected behavior for stat on windows
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
fallback to lstat when stat fails on Windows

Fixes rust-lang#109106
``@ChrisDenton`` please let me know if this is the expected behavior for stat on windows
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 17, 2023
fallback to lstat when stat fails on Windows

Fixes rust-lang#109106
```@ChrisDenton``` please let me know if this is the expected behavior for stat on windows
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 18, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#109102 (Erase escaping late-bound regions when probing for ambiguous associated types)
 - rust-lang#109200 (Fix index out of bounds in `suggest_trait_fn_ty_for_impl_fn_infer`)
 - rust-lang#109211 (E0206 - update description )
 - rust-lang#109222 (Do not ICE for unexpected lifetime with ConstGeneric rib)
 - rust-lang#109235 (fallback to lstat when stat fails on Windows)
 - rust-lang#109248 (Pass the right HIR back from `get_fn_decl`)
 - rust-lang#109251 (Suggest surrounding the macro with `{}` to interpret as a statement)
 - rust-lang#109256 (Check for llvm-tools before install)
 - rust-lang#109257 (resolve: Improve debug impls for `NameBinding`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2a3c0e3 into rust-lang:master Mar 18, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std::fs incorrect behavior when dealing with UNIX domain socket on Windows
5 participants